/****************************************Copyright (c)**************************************************
**                                         2016-03
**
**                                
**
**
**--------------File Info-------------------------------------------------------------------------------
** File name:		    ht6x1x_wdt.c
** Last modified Date:  2016-03-29
** Last Version:		v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Created by:			Evan Chen
** Created date:		2016-03-29
** Version:				v1.0
** Descriptions:		
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/

/* Includes ------------------------------------------------------------------*/
#include "ht6x1x_wdt.h"

void WDT_EnableMode(WDT_Mode_TypeDef mode)
{
	HT_WDT->WDTCFG &= ~WDTCFG_INT_RST_MASK;
	HT_WDT->WDTCFG |= mode;
}

void WDT_SetPrescaler(uint16_t prescaler)/*64ms * (1+prescaler)*/
{
	HT_WDT->WDTSET = prescaler & 0x00ff;
}

void WDT_SetLoad(uint8_t load)
{
	HT_WDT->WDTSET = load;
}

void WDT_Feed(void)
{
	HT_WDT->WDTSET = WDTCLR_CLR_FLAG;
}

